Military helicopters and ziplining commandos rescued eight people, including six schoolboys, who were trapped for hours on Tuesday in a stricken cable car high above a remote Pakistani valley.
The daring rescue began with a helicopter plucking a child to safety after almost 12 hours, but it was forced back to base as bad weather closed in and night fell.
Then, commandos from Pakistan's Special Service Group (SSG) -- known as the Maroon Berets -- used the cable keeping the gondola from plunging into the valley as a zipline to rescue the rest of those stranded.
"I thought it was my last day and I will be no more," one of the rescued boys, Attaullah Shah, told AFP.
"God has granted me a second life," the 15-year-old said.
Pakistan's caretaker Prime Minister Anwaar-ul-Haq Kakar called the rescuers "heroes of the nation".
"Great teamwork by the military, rescue departments, district administration as well as the local people," he wrote on X, formerly Twitter.
Local officials earlier said two children had been plucked by helicopter from the stricken gondola, but the military later confirmed only one had been rescued that way.
"After tireless efforts by highly skilled pilots and SSG personnel, a child was rescued but the mission had to be canceled due to bad weather," the military's media wing said in a statement.
"Further efforts were then made by the SSG troops and a special zipliner team for this purpose was flown to the crash site by army helicopters."
Adults last to be rescued
Bilal Faizi, an official with Pakistan's emergency service, said the two adults were the last to be brought to safety.
A video of the first rescue showed a teenager in a harness hanging at the bottom of a swinging rope under a helicopter as crowds cheered with relief.
"Once everyone had been rescued, the families started crying with joy and hugging each other," emergency services official Waqar Ahmad told AFP.
"People had been constantly praying because there was a fear that the rope might break. People kept praying until the last person was rescued."
The six children had been on their way to school accompanied by two adults when the chairlift broke down at around 7 am (0200 GMT) midway through its journey above the lush green Allai Valley.
Mosque loudspeakers raise alarm
Residents used mosque loudspeakers to alert neighborhood officials of the emergency, and hundreds of people gathered on both sides of the ravine -- hours away from any sizeable town -- to watch the drama unfold.
Military helicopters flew several sorties and an airman was lowered by a harness to deliver food, water and medicine to the gondola.
Earlier in the day, as the rescue operation unfolded, headmaster Ali Asghar Khan told AFP by phone that the children were all teenage boys and students at his government high school Battangi Pashto.
"The school is located in a mountainous area and there are no safe crossings, so it's common to use the chairlift," Khan said.
"The parents are gathered at the site of the chairlift. What can they do? They are waiting for the rescue officials to get their children out. We are all worried."
Abid Ur Rehman, a teacher from another school in the area, said around 500 people had gathered to watch the rescue mission.
"Parents and women are crying for the safety of their children," he told AFP.
Syed Hammad Haider, a senior Khyber Pakhtunkhwa provincial official, said the gondola was hanging about 1,000 to 1,200 feet above the ground.
Cable cars that carry passengers -- and sometimes even cars -- are common across the northern areas of Khyber Pakhtunkhwa province and Gilgit-Baltistan, and are vital in connecting villages and towns in areas where roads cannot be built.
In 2017, 10 people were killed when a chairlift cable broke, sending passengers plunging into a ravine in a mountain hamlet near the capital Islamabad.